<html>
<head>
    <title>帐号管理</title>
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="https://cdn.bootcss.com/mdui/0.4.3/css/mdui.min.css" rel="stylesheet">
   <script src="https://cdn.bootcss.com/mdui/0.4.3/js/mdui.min.js"></script>
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
    <meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />
</head>

<style type="text/css">


    body{
        align-content: center;
    }

    .mylabel{
        padding-top: 30px;
        padding-left: 20px;
        font-size: 20px;
    }

    #BasicInfo{
        border-radius: 15px;
        margin: 0 auto;
        align-content: center;
        width: 800px;
    }

    #ConInfo{
        padding-top: 15px;
        border-radius: 15px;
        margin: 30px auto;
        align-content: center;
        width: 800px;
    }

    #PhotoInfo{
        padding-top: 15px;
        border-radius: 15px;
        margin: 30px auto;
        align-content: center;
        width: 800px;
    }

    .mdui-textfield{
        margin-right: 40px;
        margin-left: 40px;
    }

    .Separate{
        padding-bottom: 30px;
    }

    #addImg{
        margin-left: 15px;
    }

    #submitButton{
        text-align: center;
        margin-bottom: 30px;
    }

    .uploadArea{
        padding: 20px;
    }
</style>

<body class="mdui-theme-primary-light-blue mdui-theme-accent-blue">

<h2 class="mdui-text-color-theme" >账号管理</h2>


    <div id="content">

        <form  id="form"  method="post" enctype="multipart/form-data">

        <div id="BasicInfo" class="mdui-shadow-5">

            <div id="basicInfoLabel" class="mylabel" >一、修改密码</div>


       <div class="mdui-textfield mdui-textfield-floating-label">
  <i class="mdui-icon material-icons">lock</i>
  <label class="mdui-textfield-label">请输入新的密码</label>
  <input class="mdui-textfield-input required" type="password" id="user_pwd" name="user_pwd" required/>
   
  <div class="mdui-textfield-error">密码不能为空</div>
</div>

             <div class="Separate"></div>

        </div>
        </div>
    </form>
     <div id="submitButton">
            <button id="submit" class="mdui-btn mdui-color-theme-accent mdui-ripple" onclick="infoSubmit()" >提交</button>
        </div>

</div>


</body>

<script>
    var $$=mdui.JQ;
    var userid = JSON.parse(sessionStorage.getItem("userid"))
    console.log(userid)
    

    function infoSubmit() {

        $$("#submit").attr("disabled","true");
        var formdata=new FormData(document.getElementById("form"));
        formdata.append("user_id",userid);
        
        
        mdui.snackbar({
            message: '上传中...',
            position: 'right-top'
        });
        $$.ajax({
            method: 'PUT',
            url: 'http://prehealth.top/pre2.0/update',
            contentType:false,
            data:formdata,
            success: function (data) {
                $$("#submit").removeAttr("disabled");
                mdui.snackbar({
                    message: '提交成功',
                    position: 'right-top'
                });
            },
            fail:function () {
                $$("#submit").removeAttr("disabled");
                mdui.snackbar({
                    message: '提交失败',
                    position: 'right-top'
                });
            }
        });



    }


</script>







</html>
